package com.csun.dsms.service;

import com.csun.dsms.comment.core.support.IService;
import com.csun.dsms.model.domain.DsmsPoor;
import com.csun.dsms.model.domain.DsmsUser;
import com.csun.dsms.model.dto.poor.ApplyPoorDto;
import com.csun.dsms.model.dto.poor.PoorDto;
import com.csun.dsms.model.dto.poor.PoorQueryDto;
import com.csun.dsms.model.vo.poor.PoorNumberVo;
import com.csun.dsms.model.vo.poor.PoorVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author chisj chisj@foxmail.com
 * @version 1.0.0
 * @date 2021-09-16 16:30
 * @description: TODO
 */
public interface DsmsPoorService extends IService<DsmsPoor> {

    /**
     * 查询特困人员列表
     *
     * @param poorQueryDto  the poor query dto
     *
     * @return  the poor vo list.
     */
    List<PoorVo> queryListWithPage(PoorQueryDto poorQueryDto);

    /**
     * 新增特困人员
     *
     * @param poorDto   the poor dto
     * @param login     the login user
     *
     * @return  the int.
     */
    Integer save(PoorDto poorDto, DsmsUser login);

    /**
     * 校验身份证号码是否存在
     *
     * @param id    the poor id
     * @param idCard    the id card
     *
     * @return  true-不存在 false-存在
     */
    boolean checkIdCard(Long id, String idCard);

    /**
     * 修改特困人员信息
     *
     * @param poorDto   the poor dto
     * @param login     the login user
     *
     * @return  the int.
     */
    Integer edit(PoorDto poorDto, DsmsUser login);

    /**
     * 通过Id查询特困人员信息.
     *
     * @param poorId    the poor id
     *
     * @return  the poor vo.
     */
    PoorVo showById(Long poorId);

    /**
     * 通过Id删除特困人员信息.
     *
     * @param poorId    the poor id
     *
     * @return  the int.
     */
    Integer deleteById(Long poorId);

    /**
     * 根据Id修改特困人员信息.
     *
     * @param dsmsPoor  the dsms poor
     * @param login     the login user
     *
     * @return  the int.
     */
    Integer modifyPoorStatusById(DsmsPoor dsmsPoor, DsmsUser login);

    /**
     * 审核特困人员
     *
     * @param applyPoorDto  the apply poor dto
     * @param login     the login user
     *
     * @return  the int.
     */
    Integer apply(ApplyPoorDto applyPoorDto, DsmsUser login);

    /**
     * 查询特困人员定位信息
     *
     * @param unitIdList    the unit id list
     *
     * @return  the poor vo
     */
    List<PoorVo> queryPoorLocationList(List<Long> unitIdList);

    /**
     * 查询特困人员服务详情
     *
     * @param id    the poor id
     *
     * @return  the poor vo
     */
    PoorVo showPoorDetailById(Long id);

    /**
     * 获取每年每个地方的特困人员数量
     *
     * @param year  年-yyyy
     *
     * @return  the poor number vo list.
     */
    List<PoorNumberVo> queryPoorNumberList(String year);

    /**
     * 查询总数
     *
     * @param year  年-yyyy
     *
     * @return  the poor total number.
     */
    Integer queryPoorTotal(String year);

    /**
     * 根据单位id查询特困人员id
     *
     * @param unitIdList    the unit id list.
     *
     * @return  the poor id list.
     */
    List<Long> selectPoorIdListByUnitList(List<Long> unitIdList);
    // 根据片区id查询所有的特困人员
    List<PoorVo> selectPoorByUnitList(List<Long> unitIdList);

    void update(List<String> idCards);
    //根据片区id查询所有的特困人员id
    List<Long> selectALLPoorIdListByUnitList(List<Long> unitIdList);

    void update1(List<String> idCards);
    // 获取特困人员数量村
    List<PoorNumberVo> queryPoorNumberListByVillage(String year);
}
